import { Checkbox } from 'antd';
import type { CheckboxValueType } from 'antd/es/checkbox/Group';
import React, {useState} from 'react';

const [valueCheckbox, setValueCheckbox] = useState(['Pear']);

const onChangeCheckbox = (checkedValues: CheckboxValueType[]) => {
  console.log('checked = ', checkedValues);
  setValueCheckbox(checkedValues as any)
};


const options = [
  { label: 'Apple', value: 'Apple' },
  { label: 'Pear', value: 'Pear' },
  { label: 'Orange', value: 'Orange' },
];


const App: React.FC = () => (
  <>
    <Checkbox.Group options={options} value={valueCheckbox} onChange={onChangeCheckbox} />
  </>
);

export default App;
